<?php
include_once 'inc/config.inc.php';
include_once 'inc/mysql.inc.php';
include_once 'inc/tool.ins.php';
$template['title'] = '入住登记';

 $link = connect();
  if(isset($_POST['submit'])){

        include 'inc/check_student_in.php';

        $query = "insert into student(sid,name,age,professional,phone,ldh,ssh) values({$_POST['sid']},'{$_POST['name']}', {$_POST['age']}, '{$_POST['professional']}',{$_POST['phone']},'{$_POST['ldh']}',{$_POST['ssh']}  );";
        $result=execute($link,$query);
        if(mysqli_affected_rows($link)==1){
            skip('index.php','glyphicon-ok-sign','入住成功,正在给你安排床位,稍候返回主页');
        }else{
            skip('student_in.php','glyphicon-remove-sign','入住未成功，请稍候重试');
        }



  }
?>



<?php  include 'include/header.php' ?>
<div id="content" class="span10">


			<ul class="breadcrumb">
				<li>
					<i class="icon-home"></i>
					<a href="index.php">Home</a>
					<i class="icon-angle-right"></i>
				</li>
				<li>
					<i class="icon-eye-open"></i>
					<a href="#">学生入住登记</a>
				</li>
			</ul>


            <form  method="post" class="animated fadeInRightBig">
                <h2>请输入入住学生信息：</h2>
                学号：<input type="text"  name="sid" value=<?php  echo $_COOKIE['hbw']['sid'];?> > <br>
                姓名：<input type="text" name="name"  ><br>

                年龄：<input type="text" name="age"><br>
                专业：<input type="text" name="professional"><br>
                电话：<input type="text" name="phone"><br>
                楼栋号：<select name="ldh" style="width:100px;color:white;background-color: #4bb1cf" >
                        <option value="东一">东一</option>
                        <option value="东二">东二</option>
                        <option value="东三">东三</option>
                        <option value="东四">东四</option>
                       </select><br>
                宿舍号：<input type="text" name="ssh"><br>

                <input type="submit" name="submit" value="添加">
            </form>





<?php  include 'include/footer.php' ?>
</body>
</html>
